The Accordion Pane Component > FAccordionPane.addListener() |
FAccordionPane.addListener()
Availability
Flash Player 6.
Usage
myAccordion_acp.addListener (listener)
Parameters
listener An Object with event methods attached.
Returns
Boolean. true if the listener was added, otherwise false.
Description
Adds a listener to the component, which can capture and respond to the 2 events fired by the component. The events are: onEnable and onSelect.
onEnable |
Event which is triggered by the Accordion Pane whenever it is enabled or disabled with the method setEnabled. |
onSelect |
Event which is triggered by the Accordion Pane whenever it is a new item is selected by the user or with the setSelectedItem method |
Example
The accordion_addListener.fla example file contains an example of using this method.
The following code creates an accordion pane with 3 sections, and then adds a listener to listen for the onSelect event.:
var sections = ["Section 1","Section 2","Section 3","Section 4"];
myAccordionPane_acp.setDataProvider(sections);
var listener = {};
listener.onSelect = function(obj,item){
trace("Item Selected: "+item.label);
}
myAccordionPane_acp.addListener(listener);
See also
FAccordionPane.removeListener()